Skip to main content
Version: Next

Mapper Algorithm

Similar to the HashList algorithm, the Mapper algorithm replaces original string data with a realistic replacement by selecting a row and generating a substitute masked string from the fields of the provided CSV files. The difference is that the Mapper algorithm guarantees a 1-to1 mapping, so each original string is mapped to a unique masked value. This requires that the supplied values in CSV resources are both unique and the number of values is greater than the original values to be masked.

Algorithm Characteristics

  • Algorithm: Mapper
  • Masking Technique: Substitution
  • Supported Types: String
  • Referential Integrity: true
  • Conflict-free: true
  • Realistic Data: true
  • Reversible: false

Properties

  • useInputCase { boolean; optional; default: false }
    If true then the case of the original data value is used when selecting a record to use as the substitute data value. This implies that 2 original data values that differ only in the case will result in different masked values.
    Example: "useInputCase": true

  • csvResources { list; required }
    A list of CSV file objects which are the source of the records used to provide the masked substitution data values. This is a list because a large amount of data may be needed and the amount of data may grow over time. Multiple files make it easier to accommodate both these requirements.
    Example:

    "csvResources": [
{
"csvFile": "obfusware/maskingdata/us-addresses.csv",
"indexList": [ 0, 1 ],
"maskFormat\": "%2$s, %1$s"
}
]
  • CSV File object properties
    The CSV File object describes a csv file, its fields, and how they can be used to generate a masked data value.
    • csvFile { string; optional; default: null }
      The name of the resource csv file which contains the replacement records used to select a substitute masked value.
      Example: "csvFile": "custom/maskingdata/names.csv"

    • index { int[]; optional; default: -1 }
      A field index used to select a field from the csvFile to be the substitute masked value.
      Example: "index": 1

    • indexList { int[]; optional; default: [ 0, 1 ] }
      The list of field indexes used to select the fields from the csvFile to generate a substitute data value. The order of the fields is significant. It is used to when they are concatenated.
      Example: "indexList": [ 0, 1 ]

    • separator { string; optional; default: (space) }
      If there are multiple fields selected using the indexList property, then separator string is used to concatenate the fields. Example: "separator": ", "

    • maskFormat { string; optional; default: null }
      If there are multiple fields selected using the indexList property, then if the maskFormat property is set, it is used as the format string for the Java String.format() method. The selected fields are provided to the String.format() method as arguments.
      (See Formatter (Java Platform SE 8 ) - Oracle Help Center for details of the format specification)
      Example: "maskFormat": ", "

Example JSON configuration

{
"name": "ExampleMapperMasker",
"description": "Replaces original string data with a realistic, culturally USA, full name in a 'lastname, firstname' comma seperated format.",
"algorithm": "Mapper",
"trimWhiteSpace": true,
"csvResources": [
{
"csvFile": "obfusware/maskingdata/us-addresses.csv",
"indexList": [ 0, 1 ],
"maskFormat\": "%2$s, %1$s"
},
{
"csvFile": "obfusware/maskingdata/us-addresses-2.csv",
"indexList": [ 0, 1 ],
"maskFormat\": "%2$s, %1$s"
}
]
}

Default Maskers based on the Token Algorithm

-NONE-
Since the supplied CSV resources must meet strict requirements with regard to uniqueness and quantity, based on the data being masked, there are no default Mapper maskers.